package com.yunxi.service.dubboService.impl.otd;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.web.ApiResult;
import com.yunxi.core.web.ResponseUtil;
import com.yunxi.otd.pojo.OtdCapacityChangeStateVO;
import com.yunxi.otd.pojo.OtdCapacityEditVO;
import com.yunxi.otd.pojo.OtdCapacityQueryVO;
import com.yunxi.otd.pojo.OtdCapacityRemoveVO;
import com.yunxi.otd.service.OtdProduceCapacityDubboService;
import com.yunxi.service.localService.otd.OtdProduceCapacityService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

/**
 * <p>
 * 产能设置 服务实现类
 * </p>
 *
 * @author XUQI
 * @since 2019-08-26
 */
public class OtdProduceCapacityDubboServiceImpl implements OtdProduceCapacityDubboService {

    @Autowired
    @Qualifier(value = "otdProduceCapacityServiceImpl")
    OtdProduceCapacityService otdProduceCapacityService;


    @Override
    public PageInfo pageByVo(OtdCapacityQueryVO queryVO, Integer pageNum, Integer pageSize) {
//        PageInfo pageInfo = otdProduceCapacityService.pageByVo(queryVO, pageNum, pageSize);
        return otdProduceCapacityService.pageByVo(queryVO, pageNum, pageSize);
    }

    /**
     * 产能设置查询
     *
     * @param queryVO 查询条件
     * @return ApiResult
     */
    @Override
    public ApiResult findProduceCapacity(OtdCapacityQueryVO queryVO) {
        return otdProduceCapacityService.findProduceCapacity(queryVO);
    }

    /**
     * 产能数编辑
     *
     * @param editVO 编辑VO
     * @return ApiResult
     */
    @Override
    public ApiResult editCapacity(OtdCapacityEditVO editVO) {
        return otdProduceCapacityService.editCapacity(editVO);
    }

    /**
     * 变更状态
     *
     * @param editVO 编辑VO
     * @return ApiResult
     */
    @Override
    public ApiResult changeState(OtdCapacityChangeStateVO editVO) {
        return otdProduceCapacityService.changeState(editVO);
    }

    /**
     * 产能数编辑
     *
     * @param editVO 编辑VO
     * @return ApiResult
     */
    @Override
    public ApiResult saveOrUpdate(OtdCapacityEditVO editVO) {
        return otdProduceCapacityService.saveOrUpdate(editVO);
    }

    /**
     * 多条删除
     *
     * @param removeVOList 删除List
     * @return ApiResult
     */
    @Override
    public ApiResult removeByVO(List<OtdCapacityRemoveVO> removeVOList) {
        otdProduceCapacityService.removeByVO(removeVOList);
        return ResponseUtil.ok();
    }

    /**
     * 记载单条
     *
     * @param id id
     * @return ApiResult
     */
    @Override
    public ApiResult load(String id) {
        return ResponseUtil.ok(otdProduceCapacityService.getById(id));
    }

    /**
     * 分页查询
     *
     * @param queryVO 查询条件
     * @return ApiResult
     */
    @Override
    public ApiResult export(OtdCapacityQueryVO queryVO) {
        return ResponseUtil.ok(otdProduceCapacityService.listByVo(queryVO));
    }
}
